class kyo {
    public String toString() {
        return "hello kyo";
    }
}

public class StringBuilderTest {
    static public void main(String [] args) {
        StringBuilder b = new StringBuilder();
        String s = new String();
        char [] c = {'a', 'b', 'c', 'd'};

        // System.out.printf("start time = %d\n", System.currentTimeMills());
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000; i++) {
            // s += '+';
            b.append('+');
        }
        // s = b.toString();
        char ch = b.charAt(999);
        int code = b.codePointAt(999);
        System.out.printf("ch = %c, code = %d\n", ch, code);
        s = b.append(c).append(new kyo()).delete(0, 999).insert(2, '#').toString();
        System.out.printf("end time = %d\n", System.currentTimeMillis() - start);

        System.out.printf("s = %s\n", s);
    }
}
